<template>
  <div class="absolute bottom-20px right-10px">
    <Icon
      :class="show ? 'rotate-135' : 'rotate-0'"
      class="transform transition-transform z-3000"
      @click="show = !show"
      :name="ButtonIcon"
      :size="50"
      v-if="per === 'manage' || per === 'bd'"
    />
    <ActionSheet v-model="show" :closeable="false">
      <div class="h-260px overflow-hidden px-20px py-18px">
        <div class="text-20px text-dark-300 font-500 pb-21px">快捷入口</div>
        <div class="flex flex-wrap">
          <div class="flex flex-col items-center w-1/4 mb-24px">
            <Icon
              @click="handleRouter('/workbench/todo')"
              :name="TodoPlusIcon"
              :size="57"
            />
            <span class="text-12px py-8px text-center">新增待办</span>
          </div>
          <div class="flex flex-col items-center w-1/4 mb-24px">
            <Icon
              @click="handleRouter('/workbench/commerce')"
              :name="BusinessPlusIcon"
              :size="57"
            />
            <span class="text-12px py-8px text-center">新增商机</span>
          </div>
          <!-- <div class="flex flex-col items-center w-1/4 mb-24px">
            <Icon
              @click="
                handleNavigation(
                  '/pages/dashboard/contractManage/productContract/process'
                )
              "
              :name="ContractPlusIcon"
              :size="57"
            />
            <span class="text-12px py-8px text-center">新增结算合同</span>
          </div> -->
          <!-- <div class="flex flex-col items-center w-1/4 mb-24px">
            <Icon
              @click="
                handleNavigation(
                  '/pages/dashboard/merchantManage/certifyMerchant/index?businessLine=0'
                )
              "
              :name="BusinessApproveIcon"
              :size="57"
            />
            <span class="text-12px py-8px text-center">认证商机</span>
          </div> -->
          <!-- <div class="flex flex-col items-center w-1/4 mb-24px">
            <Icon
              @click="
                handleNavigation(
                  '/pages/dashboard/contractManage/settlementContract/settlementProcess'
                )
              "
              :name="ServicePlusIcon"
              :size="57"
            />
            <span class="text-12px py-8px text-center">新增服务合同</span>
          </div> -->
        </div>
      </div>
    </ActionSheet>
  </div>
</template>

<script>
import { Icon, ActionSheet, Toast } from "vant";
import ButtonIcon from "@/assets/icon/plus.png";
import TodoPlusIcon from "@/assets/icon/todo-plus.png";
import BusinessPlusIcon from "@/assets/icon/business-plus.png";
import ContractPlusIcon from "@/assets/icon/contract-plus.png";
import BusinessApproveIcon from "@/assets/icon/business-approve.png";
import ServicePlusIcon from "@/assets/icon/service-plus.png";
export default {
  components: {
    Icon,
    ActionSheet,
  },
  data() {
    return {
      ButtonIcon,
      TodoPlusIcon,
      BusinessPlusIcon,
      ContractPlusIcon,
      BusinessApproveIcon,
      ServicePlusIcon,
      show: false,
      per: "",
    };
  },
  created() {
    this.per = localStorage.getItem("permission");
    console.log(this.per);
  },
  methods: {
    handleRouter(path) {
      this.show = false;
      this.$nextTick(() => {
        this.$router.push({ path });
      });
    },
    handleNavigation(path) {
      uni.webView.getEnv((res) => {
        if (res.plus) {
          uni.navigateTo({ url: path });
        } else {
          Toast("请在OAAPP环境下运行");
        }
      });
    },
    //
  },
};
</script>

<style lang="scss" scoped></style>
